﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SXICE.Core.Models;
using SXICE.IService;
using SXICE.IService.Models;
using SXICE.WebAPI.Utilities;
using AutoMapper;

namespace SXICE.WebAPI.Controllers
{
    /// <summary>
    /// 痛风控制器
    /// </summary>
    [Route("")]
    [Authorize]
    public class GoutController : ControllerBase
    {
        private readonly IGoutService goutService;

        public GoutController(IGoutService goutService)
        {
            this.goutService = goutService;
        }

        /// <summary>
        /// 下一步
        /// </summary>
        /// <param name="id">选项ID</param>
        /// <param name="start">是否为开始</param>
        /// <returns>结果</returns>
        [HttpGet]
        public ReturnResult<ProgressItem> Next(int id, bool start)
        {
            return goutService.Next(WorkContext.ToCustomer, start, id);
        }

        /// <summary>
        /// 回退
        /// </summary>
        /// <returns>结果</returns>
        [HttpGet]
        public ReturnResult<ProgressItem> Back()
        {
            return goutService.Back(WorkContext.ToCustomer);
        }
    }
}